//
//  UIImageView+videoFirstFrame.m
//  downloadTest
//
//  Created by Rambo on 2019/1/12.
//  Copyright © 2019 HB. All rights reserved.
//

#import "UIImageView+videoFirstFrame.h"
#import "HBDownloadManager.h"

@implementation UIImageView (videoFirstFrame)

- (void)hb_setVideoFirstFrameWithUrl:(NSString*)url placeholderImage:(UIImage*)placeholderImage{
    self.image = placeholderImage;
    __weak typeof(self) weakSelf = self;
    [[HBDownloadManager manager] downloadVideoFirseFrameWithurl:url complete:^(UIImage *downloadImage) {
        __strong typeof(weakSelf) strongSelf = weakSelf;
        if (strongSelf == nil) return ;
        if (downloadImage) {
            strongSelf.image = downloadImage;
        }
    }];
}

@end
